package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the TIMECARD database table.
 * 
 */
@Entity
@NamedQuery(name="Timecard.findAll", query="SELECT t FROM Timecard t")
public class Timecard implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="TIMECARD_TIMECARDID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="TIMECARD_TIMECARDID_GENERATOR")
	@Column(name="TIMECARD_ID")
	private long timecardId;

	@Column(name="TIMECARD_BEIZHU")
	private String timecardBeizhu;

	@Column(name="TIMECARD_DATE")
	private Timestamp timecardDate;

	@Column(name="TIMECARD_PERSON")
	private String timecardPerson;

	@Column(name="TIMECARD_UPDATE")
	private Timestamp timecardUpdate;

	@Column(name="TIMECARD_ZT")
	private BigDecimal timecardZt;

	//bi-directional many-to-one association to Attendancecard
	@OneToMany(mappedBy="timecard")
	@JSONField(serialize=false)
	private List<Attendancecard> attendancecards;

	//bi-directional many-to-one association to Attendancecenter
	@OneToMany(mappedBy="timecard")
	@JSONField(serialize=false)
	private List<Attendancecenter> attendancecenters;

	//bi-directional many-to-one association to StaffInformation
	@ManyToOne
	@JoinColumn(name="STAIN_ID")
	private StaffInformation staffInformation;

	public Timecard() {
	}

	public long getTimecardId() {
		return this.timecardId;
	}

	public void setTimecardId(long timecardId) {
		this.timecardId = timecardId;
	}

	public String getTimecardBeizhu() {
		return this.timecardBeizhu;
	}

	public void setTimecardBeizhu(String timecardBeizhu) {
		this.timecardBeizhu = timecardBeizhu;
	}

	public Timestamp getTimecardDate() {
		return this.timecardDate;
	}

	public void setTimecardDate(Timestamp timecardDate) {
		this.timecardDate = timecardDate;
	}

	public String getTimecardPerson() {
		return this.timecardPerson;
	}

	public void setTimecardPerson(String timecardPerson) {
		this.timecardPerson = timecardPerson;
	}

	public Timestamp getTimecardUpdate() {
		return this.timecardUpdate;
	}

	public void setTimecardUpdate(Timestamp timecardUpdate) {
		this.timecardUpdate = timecardUpdate;
	}

	public BigDecimal getTimecardZt() {
		return this.timecardZt;
	}

	public void setTimecardZt(BigDecimal timecardZt) {
		this.timecardZt = timecardZt;
	}

	public List<Attendancecard> getAttendancecards() {
		return this.attendancecards;
	}

	public void setAttendancecards(List<Attendancecard> attendancecards) {
		this.attendancecards = attendancecards;
	}

	public Attendancecard addAttendancecard(Attendancecard attendancecard) {
		getAttendancecards().add(attendancecard);
		attendancecard.setTimecard(this);

		return attendancecard;
	}

	public Attendancecard removeAttendancecard(Attendancecard attendancecard) {
		getAttendancecards().remove(attendancecard);
		attendancecard.setTimecard(null);

		return attendancecard;
	}

	public List<Attendancecenter> getAttendancecenters() {
		return this.attendancecenters;
	}

	public void setAttendancecenters(List<Attendancecenter> attendancecenters) {
		this.attendancecenters = attendancecenters;
	}

	public Attendancecenter addAttendancecenter(Attendancecenter attendancecenter) {
		getAttendancecenters().add(attendancecenter);
		attendancecenter.setTimecard(this);

		return attendancecenter;
	}

	public Attendancecenter removeAttendancecenter(Attendancecenter attendancecenter) {
		getAttendancecenters().remove(attendancecenter);
		attendancecenter.setTimecard(null);

		return attendancecenter;
	}

	public StaffInformation getStaffInformation() {
		return this.staffInformation;
	}

	public void setStaffInformation(StaffInformation staffInformation) {
		this.staffInformation = staffInformation;
	}

}